<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Oracle Pools</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_pools.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Oracle Pools<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>OCILIB support the connections and sessions pooling features introduced in Oracle 9i.</p>
<p>Let's Oracle talk about this features !</p>
<dl class="section user"><dt>Connection pools (from Oracle Call Interface Programmer's Guide)</dt><dd></dd></dl>
<p>Connection pooling is the use of a group (the pool) of reusable physical connections by several sessions, in order to balance loads. The management of the pool is done by OCI, not the application. Applications that can use connection pooling include middle-tier applications for Web application servers and e-mail servers.</p>
<dl class="section user"><dt>Session Pools (from Oracle Call Interface Programmer's Guide)</dt><dd></dd></dl>
<p>Session pooling means that the application will create and maintain a group of stateless sessions to the database. These sessions will be handed over to thin clients as requested. If no sessions are available, a new one may be created. When the client is done with the session, the client will release it to the pool. Thus, the number of sessions in the pool can increase dynamically.</p>
<dl class="section note"><dt>Note</dt><dd>OCILIB implements homogeneous session pools only.</dd></dl>
<dl class="section user"><dt>When using Pools (from Oracle Call Interface Programmer's Guide)</dt><dd></dd></dl>
<p>If database sessions are not reusable by mid-tier threads (that is, they are stateful) and the number of back-end server processes may cause scaling problems on the database, use OCI connection pooling.</p>
<p>If database sessions are reusable by mid-tier threads (that is, they are stateless) and the number of back-end server processes may cause scaling problems on the database, use OCI session pooling.</p>
<p>If database sessions are not reusable by mid-tier threads (that is, they are stateful) and the number of back-end server processes will never be large enough to potentially cause any scaling issue on the database, there is no need to use any pooling mechanism.</p>
<dl class="section user"><dt>Oracle 8i support</dt><dd></dd></dl>
<p>Pooling has bee introduced in :</p><ul>
<li>9iR1 for connection pools</li>
<li>9iR2 for session pools For Oracle 8i, OCILIB implements its own pooling mechanism in order to remain compatible with older versions. But sessions pools then are handled as connection pools</li>
</ul>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define MAX_THREADS 50</span></div>
<div class="line"><span class="preprocessor">#define MAX_CONN    10</span></div>
<div class="line"><span class="preprocessor">#define SIZE_STR   260</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> worker(<a class="code" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *thread, <span class="keywordtype">void</span> *data)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn = <a class="code" href="group___ocilib_c_api_pools.html#ga3f6f0cc0b68e1efab43b5929411dd6ab">OCI_PoolGetConnection</a>(data, NULL);</div>
<div class="line">    <span class="keywordtype">char</span> str[SIZE_STR+1];</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* application work here */</span></div>
<div class="line"></div>
<div class="line">    str[0] = 0;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#gafc660530b550458f0b5578a06e7a7a27">OCI_Immediate</a>(cn, <span class="stringliteral">&quot;select to_char(sysdate, &#39;YYYYMMDD HH24:MI:SS&#39;) from dual&quot;</span>, OCI_ARG_TEXT, str);</div>
<div class="line">    </div>
<div class="line">    printf(<span class="stringliteral">&quot;%s\n&quot;</span>, str);</div>
<div class="line">    </div>
<div class="line">    <span class="comment">/* ... */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_connections.html#gac3fe655e96074adb119908be4650a4c9">OCI_ConnectionFree</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *th[MAX_THREADS];</div>
<div class="line">    OCI_ConnPool *pool;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> i;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT | OCI_ENV_THREADED))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create pool */</span></div>
<div class="line"></div>
<div class="line">    pool = <a class="code" href="group___ocilib_c_api_pools.html#gad7685236e3829f29e69dfa1c20c9e7e0">OCI_PoolCreate</a>(<span class="stringliteral">&quot;db&quot;</span>, <span class="stringliteral">&quot;usr&quot;</span>, <span class="stringliteral">&quot;pwd&quot;</span>, OCI_POOL_CONNECTION, OCI_SESSION_DEFAULT, 0, MAX_CONN, 1);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create threads */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (i = 0; i &lt; MAX_THREADS; i++)</div>
<div class="line">    {</div>
<div class="line">        th[i] = <a class="code" href="group___ocilib_c_api_threading.html#ga1a2474e874215e0b42109ba042de5e3a">OCI_ThreadCreate</a>();</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_threading.html#ga1076c9942cc395f298ca350021031bfd">OCI_ThreadRun</a>(th[i], worker, pool);</div>
<div class="line">    }</div>
<div class="line">  </div>
<div class="line">    <span class="comment">/* wait for threads and cleanup */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (i = 0; i &lt; MAX_THREADS; i++)</div>
<div class="line">    {</div>
<div class="line">       <a class="code" href="group___ocilib_c_api_threading.html#gadfec0263c6b8d508126a806c85898fb9">OCI_ThreadJoin</a>(th[i]);</div>
<div class="line">       <a class="code" href="group___ocilib_c_api_threading.html#gada7fa41aeedc7be2ce4f40c93ece524d">OCI_ThreadFree</a>(th[i]);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_pools.html#gaeebfa67b8c6013c1ae9c0b97b317e1bf">OCI_PoolFree</a>(pool);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad7685236e3829f29e69dfa1c20c9e7e0"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gad7685236e3829f29e69dfa1c20c9e7e0">OCI_PoolCreate</a> (const otext *db, const otext *user, const otext *pwd, unsigned int type, unsigned int mode, unsigned int min_con, unsigned int max_con, unsigned int incr_con)</td></tr>
<tr class="memdesc:gad7685236e3829f29e69dfa1c20c9e7e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an Oracle pool of connections or sessions.  <a href="#gad7685236e3829f29e69dfa1c20c9e7e0">More...</a><br /></td></tr>
<tr class="separator:gad7685236e3829f29e69dfa1c20c9e7e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeebfa67b8c6013c1ae9c0b97b317e1bf"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gaeebfa67b8c6013c1ae9c0b97b317e1bf">OCI_PoolFree</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:gaeebfa67b8c6013c1ae9c0b97b317e1bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a pool object.  <a href="#gaeebfa67b8c6013c1ae9c0b97b317e1bf">More...</a><br /></td></tr>
<tr class="separator:gaeebfa67b8c6013c1ae9c0b97b317e1bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f6f0cc0b68e1efab43b5929411dd6ab"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga3f6f0cc0b68e1efab43b5929411dd6ab">OCI_PoolGetConnection</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool, const otext *tag)</td></tr>
<tr class="memdesc:ga3f6f0cc0b68e1efab43b5929411dd6ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a connection from the pool.  <a href="#ga3f6f0cc0b68e1efab43b5929411dd6ab">More...</a><br /></td></tr>
<tr class="separator:ga3f6f0cc0b68e1efab43b5929411dd6ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab3de34dcf6eb9c5aac381074eea6f199"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gab3de34dcf6eb9c5aac381074eea6f199">OCI_PoolGetTimeout</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:gab3de34dcf6eb9c5aac381074eea6f199"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the idle timeout for connections/sessions in the pool.  <a href="#gab3de34dcf6eb9c5aac381074eea6f199">More...</a><br /></td></tr>
<tr class="separator:gab3de34dcf6eb9c5aac381074eea6f199"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga44c2acfecf3b318b34c7301768cc0053"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga44c2acfecf3b318b34c7301768cc0053">OCI_PoolSetTimeout</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool, unsigned int value)</td></tr>
<tr class="memdesc:ga44c2acfecf3b318b34c7301768cc0053"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the connections/sessions idle timeout.  <a href="#ga44c2acfecf3b318b34c7301768cc0053">More...</a><br /></td></tr>
<tr class="separator:ga44c2acfecf3b318b34c7301768cc0053"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4621ce46c4ff8f0b4888a7fc964c8d80"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga4621ce46c4ff8f0b4888a7fc964c8d80">OCI_PoolGetNoWait</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:ga4621ce46c4ff8f0b4888a7fc964c8d80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the waiting mode used when no more connections/sessions are available from the pool.  <a href="#ga4621ce46c4ff8f0b4888a7fc964c8d80">More...</a><br /></td></tr>
<tr class="separator:ga4621ce46c4ff8f0b4888a7fc964c8d80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9831b1900b8c05e25bebd4774167317a"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga9831b1900b8c05e25bebd4774167317a">OCI_PoolSetNoWait</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool, boolean value)</td></tr>
<tr class="memdesc:ga9831b1900b8c05e25bebd4774167317a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the waiting mode used when no more connections/sessions are available from the pool.  <a href="#ga9831b1900b8c05e25bebd4774167317a">More...</a><br /></td></tr>
<tr class="separator:ga9831b1900b8c05e25bebd4774167317a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25ccd51b5a7e7f48950e1dbfe847c3f6"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga25ccd51b5a7e7f48950e1dbfe847c3f6">OCI_PoolGetBusyCount</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:ga25ccd51b5a7e7f48950e1dbfe847c3f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current number of busy connections/sessions.  <a href="#ga25ccd51b5a7e7f48950e1dbfe847c3f6">More...</a><br /></td></tr>
<tr class="separator:ga25ccd51b5a7e7f48950e1dbfe847c3f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga41cd5b1fdb6470f5d4c2820ffb3692f1"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga41cd5b1fdb6470f5d4c2820ffb3692f1">OCI_PoolGetOpenedCount</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:ga41cd5b1fdb6470f5d4c2820ffb3692f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current number of opened connections/sessions.  <a href="#ga41cd5b1fdb6470f5d4c2820ffb3692f1">More...</a><br /></td></tr>
<tr class="separator:ga41cd5b1fdb6470f5d4c2820ffb3692f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga314ddcfc569ffc89ae0af75f9ba2db76"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga314ddcfc569ffc89ae0af75f9ba2db76">OCI_PoolGetMin</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:ga314ddcfc569ffc89ae0af75f9ba2db76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the minimum number of connections/sessions that can be opened to the database.  <a href="#ga314ddcfc569ffc89ae0af75f9ba2db76">More...</a><br /></td></tr>
<tr class="separator:ga314ddcfc569ffc89ae0af75f9ba2db76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6b304c6e115acacd99a7d39a3e828bdb"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#ga6b304c6e115acacd99a7d39a3e828bdb">OCI_PoolGetMax</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:ga6b304c6e115acacd99a7d39a3e828bdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the maximum number of connections/sessions that can be opened to the database.  <a href="#ga6b304c6e115acacd99a7d39a3e828bdb">More...</a><br /></td></tr>
<tr class="separator:ga6b304c6e115acacd99a7d39a3e828bdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa3a7066a1220f4e20dedebd7f49a121"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gaaa3a7066a1220f4e20dedebd7f49a121">OCI_PoolGetIncrement</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:gaaa3a7066a1220f4e20dedebd7f49a121"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the increment for connections/sessions to be opened to the database when the pool is not full.  <a href="#gaaa3a7066a1220f4e20dedebd7f49a121">More...</a><br /></td></tr>
<tr class="separator:gaaa3a7066a1220f4e20dedebd7f49a121"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc15e6a573cd8d3fbd2e346b770a27f5"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gacc15e6a573cd8d3fbd2e346b770a27f5">OCI_PoolGetStatementCacheSize</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool)</td></tr>
<tr class="memdesc:gacc15e6a573cd8d3fbd2e346b770a27f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the maximum number of statements to keep in the pool statement cache.  <a href="#gacc15e6a573cd8d3fbd2e346b770a27f5">More...</a><br /></td></tr>
<tr class="separator:gacc15e6a573cd8d3fbd2e346b770a27f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad6afcf9e91c4757c2025261d8135f3d4"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_pools.html#gad6afcf9e91c4757c2025261d8135f3d4">OCI_PoolSetStatementCacheSize</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *pool, unsigned int value)</td></tr>
<tr class="memdesc:gad6afcf9e91c4757c2025261d8135f3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the maximum number of statements to keep in the pool statement cache.  <a href="#gad6afcf9e91c4757c2025261d8135f3d4">More...</a><br /></td></tr>
<tr class="separator:gad6afcf9e91c4757c2025261d8135f3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gad7685236e3829f29e69dfa1c20c9e7e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a>* OCI_API OCI_PoolCreate </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>db</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>user</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>pwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>min_con</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_con</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>incr_con</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Create an Oracle pool of connections or sessions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">db</td><td>- Oracle Service Name </td></tr>
    <tr><td class="paramname">user</td><td>- Oracle User name </td></tr>
    <tr><td class="paramname">pwd</td><td>- Oracle User password </td></tr>
    <tr><td class="paramname">type</td><td>- Type of pool </td></tr>
    <tr><td class="paramname">mode</td><td>- Session mode </td></tr>
    <tr><td class="paramname">min_con</td><td>- minimum number of connections/sessions that can be opened. </td></tr>
    <tr><td class="paramname">max_con</td><td>- maximum number of connections/sessions that can be opened. </td></tr>
    <tr><td class="paramname">incr_con</td><td>- next increment for connections/sessions to be opened</td></tr>
  </table>
  </dd>
</dl>
<p>Possible values for parameter 'type':</p><ul>
<li>OCI_POOL_CONNECTION</li>
<li>OCI_POOL_SESSION</li>
</ul>
<p>Possible values for parameter 'mode':</p><ul>
<li>OCI_SESSION_DEFAULT</li>
<li>OCI_SESSION_SYSDAB</li>
<li>OCI_SESSION_SYSOPER</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>External credentials are supported by supplying a null value for the 'user' and 'pwd' parameters If the param 'db' is NULL then a connection to the default local DB is done</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Connection or session pool handle on success or NULL on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a9187e73af99e3f713b7824ec7e638498">ocilib::Pool::Open()</a>.</p>

</div>
</div>
<a class="anchor" id="gaeebfa67b8c6013c1ae9c0b97b317e1bf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_PoolFree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Destroy a pool object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a9187e73af99e3f713b7824ec7e638498">ocilib::Pool::Open()</a>.</p>

</div>
</div>
<a class="anchor" id="ga3f6f0cc0b68e1efab43b5929411dd6ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a>* OCI_API OCI_PoolGetConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>tag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Get a connection from the pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
    <tr><td class="paramname">tag</td><td>- user tag string</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Session tagging</dt><dd></dd></dl>
<p>Session pools have a nice feature that is 'session tagging' It's possible to tag a session with a string identifier when the session is returned to the pool, it keeps its tags. When requesting a connection from the session pool, it's possible to request a session that has the given 'tag' parameter If one exists, it is returned. If not and if an untagged session is available, it is then returned. So check the connection tag property with <a class="el" href="group___ocilib_c_api_connections.html#ga2703e4c986b2d6827184b10a5aa527af" title="Return the tag associated the given connection. ">OCI_GetSessionTag()</a> to find out if the returned connection is tagged or not.</p>
<p>This features is described in the OCI developer guide as the following :</p>
<p>"The tags provide a way for users to customize sessions in the pool. A client may get a default or untagged session from a pool, set certain attributes on the session (such as NLS settings), and return the session to the pool, labeling it with an appropriate tag. The user may request a session with the same tags in order to have a session with the same attributes"</p>
<dl class="section return"><dt>Returns</dt><dd>Connection handle otherwise NULL on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a0b49ae68d9484fbb6048cea29635f402">ocilib::Pool::GetConnection()</a>.</p>

</div>
</div>
<a class="anchor" id="gab3de34dcf6eb9c5aac381074eea6f199"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetTimeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Get the idle timeout for connections/sessions in the pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Connections/sessions idle for more than this time value (in seconds) is terminated</dd>
<dd>
Timeout is not available for internal pooling implementation (client &lt; 9i) </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#aaa62c7c0530cc7aa8d5be3992653c1c0">ocilib::Pool::GetTimeout()</a>.</p>

</div>
</div>
<a class="anchor" id="ga44c2acfecf3b318b34c7301768cc0053"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_PoolSetTimeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Set the connections/sessions idle timeout. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
    <tr><td class="paramname">value</td><td>- Timeout value</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>connections/sessions idle for more than this time value (in seconds) is terminated</dd>
<dd>
This call has no effect if pooling is internally implemented (client &lt; 9i) </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#ae4ae2a3b58e10c25f7921a95b2727158">ocilib::Pool::SetTimeout()</a>.</p>

</div>
</div>
<a class="anchor" id="ga4621ce46c4ff8f0b4888a7fc964c8d80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_PoolGetNoWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Get the waiting mode used when no more connections/sessions are available from the pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>FALSE to wait for an available object if the pool is saturated</li>
<li>TRUE to not wait for an available object </li>
</ul>
</dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#aaef56178b946f16b68ec9e0eaaa8cd43">ocilib::Pool::GetNoWait()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9831b1900b8c05e25bebd4774167317a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_PoolSetNoWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Set the waiting mode used when no more connections/sessions are available from the pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
    <tr><td class="paramname">value</td><td>- wait for object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Pass :<ul>
<li>FALSE to wait for an available object if the pool is saturated</li>
<li>TRUE to not wait for an available object </li>
</ul>
</dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a3cf9bd8b24283c1066fc223295785cc1">ocilib::Pool::SetNoWait()</a>.</p>

</div>
</div>
<a class="anchor" id="ga25ccd51b5a7e7f48950e1dbfe847c3f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetBusyCount </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the current number of busy connections/sessions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a5b2a1f5e1ad328fbb369611a63f4793e">ocilib::Pool::GetBusyConnectionsCount()</a>.</p>

</div>
</div>
<a class="anchor" id="ga41cd5b1fdb6470f5d4c2820ffb3692f1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetOpenedCount </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the current number of opened connections/sessions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#ab65a0bea2243cb19b6f38cbaca65459e">ocilib::Pool::GetOpenedConnectionsCount()</a>.</p>

</div>
</div>
<a class="anchor" id="ga314ddcfc569ffc89ae0af75f9ba2db76"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetMin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the minimum number of connections/sessions that can be opened to the database. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a3274112c3ca6c3b2b73084f84a90f6ae">ocilib::Pool::GetMinSize()</a>.</p>

</div>
</div>
<a class="anchor" id="ga6b304c6e115acacd99a7d39a3e828bdb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetMax </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the maximum number of connections/sessions that can be opened to the database. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#adc97c37f8bf390be12f8b39126b8aa8b">ocilib::Pool::GetMaxSize()</a>.</p>

</div>
</div>
<a class="anchor" id="gaaa3a7066a1220f4e20dedebd7f49a121"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetIncrement </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the increment for connections/sessions to be opened to the database when the pool is not full. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#a5bf09b5846be6574ac7d0eafd61c2ad6">ocilib::Pool::GetIncrement()</a>.</p>

</div>
</div>
<a class="anchor" id="gacc15e6a573cd8d3fbd2e346b770a27f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_PoolGetStatementCacheSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the maximum number of statements to keep in the pool statement cache. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Default value is 20 (value from Oracle Documentation) </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#ada797935cfcceb9951b3c979348f5aee">ocilib::Pool::GetStatementCacheSize()</a>.</p>

</div>
</div>
<a class="anchor" id="gad6afcf9e91c4757c2025261d8135f3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_PoolSetStatementCacheSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga03591b6a21bfc75df4bbd9c9005307fa">OCI_Pool</a> *&#160;</td>
          <td class="paramname"><em>pool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Set the maximum number of statements to keep in the pool statement cache. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pool</td><td>- Pool handle </td></tr>
    <tr><td class="paramname">value</td><td>- maximum number of statements in the cache</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_pool.html#af2fb81be5059d4f0a089b704f6a8fc03">ocilib::Pool::SetStatementCacheSize()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:36 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
